var http = require('http');
var port = 80;
var ip = '127.0.0.1';
var server = http.createServer(function (request, response) {
	console.log(request.url);
	response.statusCode = 200;
	response.setHeader('Content-Type','text/html');
	response.setHeader('Server','private server');
	var s='';
	if (request.url=='/index.html') {
		var s = '<html><head></head>';
		s+='<body style="background-color:#666;"><h1 style="color:red;text-align:center">这是主页</h1><a href="index.html">主页</a><a href="about.html" style="text-decoration:none;margin-left:20px;">关于我们</a></body>';
		s+='</html>';
	}else if (request.url=='/about.html') {
		var s = '<html><head></head>';
		s+='<body style="background-color:#567;"><h1 style="color:blue">这是关于我们</h1><a href="index.html">主页</a><a href="about.html" style="text-decoration:none;display:block;">关于我们</a></body>';
		s+='</html>'
	}
	response.write(s)
	response.end();
})
server.listen(port);
console.log('Server running at http://%s:%s/',ip,port);





